const sortCollection = require('./sortlibs/sort');

let arr = [2, 1, 4, 3, 8, 7, 44, 43, 10, 11, 22];
console.log(sortCollection.bubbleSort(arr)); // [ 1, 2, 3, 4, 7, 8, 10, 11, 22, 43, 44 ]

console.log('===========选择排序：===========');
console.log(sortCollection.selectSort([1, 5, 4, 7, 9, 22, 11, 30, 2, 33]));
// 通过测试发现选择排序比冒泡排序要快很多. 选择排序所花时间大概是冒泡排序的1/17左右.
console.log('===========选择排序(倒序): ==============');
console.log(sortCollection._selectSort([3, 5, 4, 7, 9, 22, 11, 30, 2, 33, 100]));

console.log('===========插入排序(倒序): ==============');
console.log(sortCollection.insertSort([3, 1, 5, 2, 11, 6, 4, 7, 0, 10, 20, 33, 112, 30, 31, 36]));
console.log('===========希尔排序(倒序): ==============');
console.log(sortCollection.shellSort([11, 3, 1, 5, 2, 12, 6, 4, 7, 0, 10, 9]));